package com.atguigu;/**
 * @author cyd
 * @date 2021/11/15 9:08
 * @version 1.0.0
 */

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @ClassName : com.atguigu.Consumerhystrixmain80
 * @Description : 类描述
 * Created by cyd on 2021-11-15 09:08:07
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients  // 激活openFeign
@EnableHystrix // 激活服务保护
public class ConsumerHystrixMain80 {
    private static ConfigurableApplicationContext context;

    public static void main(String[] args) {
        context = SpringApplication.run(ConsumerHystrixMain80.class, args);
        System.out.println("--------------项目启动了---------------");
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        System.out.println(port);
        System.out.println("http://localhost:" + port + "/consumer/hystrix/ok/1");
        System.out.println("http://localhost:" + port + "/consumer/hystrix/timeOut/1");

    }
}
